package com.demo.gulimall.product.entity;

import java.util.Date;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import java.io.Serializable;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

/**
 * 商品评价
 *
 * @author Chen Yuan
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("pms_spu_comment")
public class SpuComment implements Serializable {
	/** id */
	@TableId(type = IdType.ID_WORKER) // 老版本
    //@TableId(type = IdType.ASSIGN_ID) // 新版本
	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`id`")
	private Long id;

	/** sku_id */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`sku_id`")
	private Long skuId;

	/** spu_id */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableField(value = "`spu_id`")
	private Long spuId;

	/** 商品名字 */
	@TableField(value = "`spu_name`")
	private String spuName;

	/** 会员昵称 */
	@TableField(value = "`member_nick_name`")
	private String memberNickName;

	/** 星级 */
	@TableField(value = "`star`")
	private Byte star;

	/** 会员ip */
	@TableField(value = "`member_ip`")
	private String memberIp;

	/** 创建时间 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="Asia/Shanghai")
	@TableField(value = "`create_time`")
	private Date createTime;

	/** 显示状态[0-不显示，1-显示] */
	@TableField(value = "`show_status`")
	private Byte showStatus;

	/** 购买时属性组合 */
	@TableField(value = "`spu_attributes`")
	private String spuAttributes;

	/** 点赞数 */
	@TableField(value = "`likes_count`")
	private Integer likesCount;

	/** 回复数 */
	@TableField(value = "`reply_count`")
	private Integer replyCount;

	/** 评论图片/视频[json数据；[{type:文件类型,url:资源路径}]] */
	@TableField(value = "`resources`")
	private String resources;

	/** 内容 */
	@TableField(value = "`content`")
	private String content;

	/** 用户头像 */
	@TableField(value = "`member_icon`")
	private String memberIcon;

	/** 评论类型[0 - 对商品的直接评论，1 - 对评论的回复] */
	@TableField(value = "`comment_type`")
	private Byte commentType;

}
